import { defineConfig } from "vite";
import svgr from "vite-plugin-svgr";
import react from "@vitejs/plugin-react";
import { resolve } from "path";

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react(), svgr()],
  css: {
    // 如果你需要自定义 less-loader 选项，可以在这里添加
    // 例如，添加全局变量
    preprocessorOptions: {
      // 这里的选项会传递给 less-loader
      globalVars: {
        "primary-color": "#029CFD",
      },
    },
  },
  resolve: {
    alias: {
      "@": resolve(__dirname, "./src"),
      stories: resolve(__dirname, "./src/stories"),
    },
  },
});
